//
//  PlayNewViewController.m
//  TLS
//
//  Created by 屠淋 on 15/11/24.
//  Copyright © 2015年 tulin. All rights reserved.
//

#import "PlayNewViewController.h"

@interface PlayNewViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activituInVC;

@property (weak, nonatomic) IBOutlet UIWebView *webViwe;


@end

@implementation PlayNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = self.Navtitle;
    
    self.webViwe.delegate = self;
    
    if (self.urlPath) {
        
        [self.webViwe loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.urlPath]]];
        
    }else{
    
        [self.view  alertViewShowWithMessage:@"The URL is Null." View:self.navigationController.view];

    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

- (void)webViewDidStartLoad:(UIWebView *)webView{

    [self.activituInVC startAnimating];
}

-(void)webViewDidFinishLoad:(UIWebView *)webView{
    NSLog(@"加载结束");
    
    [self.activituInVC stopAnimating];
    [self.activituInVC removeFromSuperview];
    
}

-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    
    NSLog(@"ERROR:%@",error);
    NSLog(@"加载失败");
//    [self.view  alertViewShowWithMessage:@"There was a problem with URL." View:self.navigationController.view];

}

@end
